package com.fenqile.pop.utility;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public class TypeToken<T> {
	
	private Type genericType;
	
	public TypeToken() {
		Type mySuperClass = getClass().getGenericSuperclass();
		genericType = ((ParameterizedType)mySuperClass).getActualTypeArguments()[0];
	}
	
	public Type getGenericType() {
		return genericType;
	}
	
	@SuppressWarnings("unchecked")
	public Class<T> getGenericClass() {
		return (Class<T>)genericType;
	}
	
}
